//
//  ZYTheHighestScoreCell.m
//  BestLearning
//
//  Created by ちょうかんこん on 2017/12/19.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "ZYTheHighestScoreCell.h"
#import "ZYAllsModel.h"
@implementation ZYTheHighestScoreCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        
        [self setUpSuperView];
    }
    
    
    

    return self;
    
    
}


- (void)assignByZYAllsModel:(ZYAllsModel *)model{
    
    
     self.titleLabel.text = [NSString stringWithFormat:@"三好竞赛题目：%@",model.paperName];
    self.nameLabel.text = [NSString stringWithFormat:@"姓名：%@",[model.user valueForKey:@"petName"]];
   
    
    self.safflowerCountLabel.text = [NSString stringWithFormat:@"红花数：%@",model.resultFlowers];
    
    
    
}


- (void)setUpSuperView{
    
    self.titleLabel  = [UILabel new];
    self.titleLabel.font = [UIFont systemFontOfSize:14];
//    self.titleLabel.backgroundColor = [UIColor redColor];
    self.titleLabel.numberOfLines = 0;
    [self.contentView addSubview:self.titleLabel];
    
    
    
    self.nameLabel = [UILabel new];
//    self.nameLabel.backgroundColor = [UIColor orangeColor];
    self.nameLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.nameLabel];
    
    
    self.safflowerCountLabel = [UILabel new];
    self.safflowerCountLabel.font = [UIFont systemFontOfSize:14];
//    self.safflowerCountLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.safflowerCountLabel];
    
    
    
    self.titleLabel.text = @"三好竞赛题目";
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(8);
        make.top.offset(10);
        make.right.equalTo(self).offset(-8);
    }];
    
    
    self.nameLabel.text = @"北京";
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(8);
    }];
    
    
    
    self.safflowerCountLabel.text = @"100朵";
    [self.safflowerCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.top.equalTo(self.nameLabel.mas_bottom).offset(8);
    }];
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(self.safflowerCountLabel).offset(8);
    }];
    
    
    
    
    
    
    
    
}




















































@end
